package com.quktzhuanka.app.activity;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.view.View;

import com.quktzhuanka.app.R;
import com.quktzhuanka.app.base.BaseActivity;
import com.quktzhuanka.app.common.T;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class PacketActivity extends BaseActivity {
    @Override
    protected void initUI() {
        setContentView(R.layout.activity_ad);
        ButterKnife.bind(this);
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        }
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {
        findViewById(R.id.open_zfb).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = getPackageManager().getLaunchIntentForPackage("com.eg.android.AlipayGphone");
                if (intent != null) {
                    //获取剪贴板管理器：
                    ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
                    // 创建普通字符型ClipData
                    ClipData mClipData = ClipData.newPlainText("Label","640452457");
                    // 将ClipData内容放到系统剪贴板里。
                    cm.setPrimaryClip(mClipData);
                    startActivity(intent);
                } else {
                    T.showShort(PacketActivity.this, "未安装支付宝客户端");
                }
            }
        });
    }
    @OnClick(R.id.tv_left)
    public void onViewClicked() {
        finish();
    }
}
